﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers {
    import net.wooga.pets.models.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.services.*;

    public class LoadUserDataCommand extends Command {

		[Inject]
        public var socialNetworkService:ISocialNetworkService;
		[Inject]
        public var userModel:UserModel;
		[Inject]
        public var languageModel:LanguageModel;
		[Inject]
        public var sessionModel:SessionModel;

        override public function execute():void{
            this.socialNetworkService.getInfo([this.userModel.mySocialID], ["first_name"], this.onUserName);
        }
        private function onUserName(_arg1:Array):void{
            this.userModel.userName = _arg1[0].first_name;
            this.languageModel.replaceUsernamePlacehholders(this.userModel.userName);
            this.languageModel.replaceFormatTags();
        }

    }
}//package net.wooga.pets.controllers 
